import 'dart:convert';

import 'package:mahjong/const/CacheConst.dart';
import 'package:mahjong/entity/UserEntityInfo.dart';

import 'CacheUtil.dart';

class UserUtil {
  static UserEntityInfo getUserInfo() {
    UserEntityInfo userInfoEntity;
    try {
      userInfoEntity = UserEntityInfo.fromJson(Map.castFrom(json.decode(
          CacheUtil.preferencesInstance.getString(CacheConst.userInfo))));
    } catch (e) {
      print(e);
    }
    return userInfoEntity;
  }
}
